package com.siki.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Author Siki
 * @Date 2020/4/24
 *
 * @Description Mybatis-plus配置
 */
@Configuration
@EnableTransactionManagement
public class MyBatisPlusGenerator {
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor page = new PaginationInterceptor();
        page.setLimit(20);
        page.setCountSqlParser(new JsqlParserCountOptimize(true));
        page.setDialectType("mysql");
        return page;
    }

}
